package d0325;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Properties;

public class TestMessageFormat {
    public static void main(String[] args) {
        try {
            FileReader fr = new FileReader(new File("src//com//d0325//message.properties"));
            Properties properties = new Properties();
            properties.load(fr);
            System.out.println(MessageFormat.format((String) properties.get("pattern"),new Object[]{"Alice", 134.8}));
            System.out.println(MessageFormat.format((String) properties.get("pattern"), new Object[]{"Lily", 4334.8}));
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}